Filter hook 'taxonomy_labels_{$taxonomy}'

in WP Core File wp-includes/taxonomy.php at line 749

View Source

taxonomy_labels_{$taxonomy}

Filter Hook
Description
Filters the labels of a specific taxonomy. The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. Possible hook names include: - `taxonomy_labels_category` - `taxonomy_labels_post_tag`

Hook Information

File Location wp-includes/taxonomy.php View on GitHub
Hook Type Filter
Line Number 749

Hook Parameters

Type Name Description
object $labels Object with labels for the taxonomy as member variables.

Usage Examples

Basic Usage
<?php
// Hook into taxonomy_labels_{$taxonomy}
add_filter('taxonomy_labels_{$taxonomy}', 'my_custom_filter', 10, 1);

function my_custom_filter($labels) {
    // Your custom filtering logic here
    return $labels;
}

Source Code Context

wp-includes/taxonomy.php:749 - How this hook is used in WordPress core
<?php
 744  	 *
 745  	 * @see get_taxonomy_labels() for the full list of taxonomy labels.
 746  	 *
 747  	 * @param object $labels Object with labels for the taxonomy as member variables.
 748  	 */
 749  	$labels = apply_filters( "taxonomy_labels_{$taxonomy}", $labels );
 750  
 751  	// Ensure that the filtered labels contain all required default values.
 752  	$labels = (object) array_merge( (array) $default_labels, (array) $labels );
 753  
 754  	return $labels;

PHP Documentation

<?php
/**
	 * Filters the labels of a specific taxonomy.
	 *
	 * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
	 *
	 * Possible hook names include:
	 *
	 *  - `taxonomy_labels_category`
	 *  - `taxonomy_labels_post_tag`
	 *
	 * @since 4.4.0
	 *
	 * @see get_taxonomy_labels() for the full list of taxonomy labels.
	 *
	 * @param object $labels Object with labels for the taxonomy as member variables.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/taxonomy.php
Related Hooks

Related hooks will be displayed here in future updates.